<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Document</title>
	</head>
	<body>
		<script type="text/javascript">
			//继承模块
			//rect.js文件
			function area{width,height}{
				let s=width*height;
				return s;
			}
			export {area};
			......
			//rectPlus.js文件
			export * from './rect.js';	//继承模块
			export let pi=3.1415;
			export default function(width,height){
				let m=2*(width+height);
				return m;
			}
			......
			//index.html文件
			import * as rectplus from './rectPlus.js'
			console.log(rectplus.area(3,5));	//继承自父模块
			console.log(rectplus.pi);
			
			import perim from './rectPlus.js';//rectPlus模块默认方法
			console.log(perim(4,6));
		</script>
	</body>
</html>